package com.yld.scott.ch12;

import java.io.File;
import java.io.FileInputStream;
import java.io.InputStream;
import java.util.Iterator;
import java.util.Properties;
import java.util.Set;

public class PropertiesTest {
	
	
	public static void main(String[] args) throws Exception {
		
		
		//派侦查兵
		File file = new File("src/main/resources/jdbc.properties");
		
		
		Properties ps= new Properties();
		
		InputStream is = new FileInputStream(file);
		
		ps.load(is);
		
		
		Set<Object> keySet = ps.keySet();
		
		Iterator<Object> iterator = keySet.iterator();
		
		while(iterator.hasNext()){
			String key  =  (String)iterator.next();
			String value = (String)ps.get(key);
			System.out.println("key="+key+" ,value="+value);
		}
	}

}
